package cn.shuangliang.contract.service;

import cn.shuangliang.contract.dao.ContracthistoryMapper;
import cn.shuangliang.contract.model.Contracthistory;
import cn.shuangliang.contract.vo.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
@Service
public class HistoryService {
    @Autowired
    private   ContracthistoryMapper mapper;
    public Page<Contracthistory> search(  int pageNo , int pageSize,  String billno,  String pname,   Date start, Date end){


            List<Contracthistory> search = mapper.search(pageNo, pageSize, billno, pname, start, end);
            int total = mapper.searchTotal(billno, pname, start, end);
            return new Page<Contracthistory>(search,pageNo,total, pageSize);

    }

    public List<Contracthistory> exportsearch(    String billno,  String pname,   Date start, Date end){


            List<Contracthistory> search = mapper.exportSearch(billno, pname, start, end);

            return search;

    }
}
